package com.haiyou.dc.es.kafka;

import com.haiyou.dc.es.bi.impl.EsXunWuHouseService;
import com.haiyou.dc.es.constant.EsConstant;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.kafka.annotation.KafkaListener;
import org.springframework.stereotype.Component;

/**
 * @author pc
 */
@Component
@Slf4j
public class EsHouseConsumer {

    @Autowired
    private EsXunWuHouseService esXunWuHouseService;

    @KafkaListener(topics = EsConstant.XUNWU_TOPIC_NAME)
    public void handleMessage(Integer id) {
        log.info("---------------------->接收信息={}", id);
        esXunWuHouseService.addHouse(id);
    }

}
